import request from '@/router/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/api/rb-core/core/rejectreason/reject_reason/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const getDetail = (id) => {
  return request({
    url: '/api/rb-core/core/rejectreason/reject_reason/detail',
    method: 'get',
    params: {
      id
    }
  })
}

export const remove = (ids) => {
  return request({
    url: '/api/rb-core/core/rejectreason/reject_reason/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const add = (row) => {
  return request({
    url: '/api/rb-core/core/rejectreason/reject_reason/submit',
    method: 'post',
    data: row
  })
}

export const update = (row) => {
  return request({
    url: '/api/rb-core/core/rejectreason/reject_reason/submit',
    method: 'post',
    data: row
  })
}

/* 驳回理由详情 */
export const getDetailSecond = (id) => {
  return request({
    url: '/api/rb-core/core/rejectReason/reject_reason/detailSecond',
    method: 'get',
    params: {
      id
    }
  })
}

/* 驳回类型分页 */
export const getPageFirst = (current, size, params) => {
  return request({
    url: '/api/rb-core/core/rejectReason/reject_reason/page',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

/* 驳回理由分页 */
export const getPageSecond = (current, size, params) => {
  return request({
    url: '/api/rb-core/core/rejectReason/reject_reason/pageSecond',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

/* 驳回类型提交 */
export const submitFirst = (row) => {
  return request({
    url: '/api/rb-core/core/rejectReason/reject_reason/submitFirst',
    method: 'post',
    data: row
  })
}

/* 驳回理由提交 */
export const submitSecond = (row) => {
  return request({
    url: '/api/rb-core/core/rejectReason/reject_reason/submitSecond',
    method: 'post',
    data: row
  })
}

/* 驳回类型删除 */
export const deleteFirst = (id) => {
  return request({
    url: '/api/rb-core/core/rejectReason/reject_reason/deleteFirst',
    method: 'post',
    params: {
      id,
    }
  })
}

/* 驳回理由删除 */
export const deleteSecond = (id) => {
  return request({
    url: '/api/rb-core/core/rejectReason/reject_reason/deleteSecond',
    method: 'post',
    params: {
      id,
    }
  })
}

